package com.qfedu.provider.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.qfedu.param.DynamicAdd;
import com.qfedu.provider.entity.DbDynamics;
import com.qfedu.utils.R;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
* @author Administrator
* @description 针对表【db_dynamics(动态，图文混排)】的数据库操作Service
* @createDate 2024-11-23 11:16:39
*/
public interface DbDynamicsService extends IService<DbDynamics> {

    /**
     * 查询所有动态
     * @return
     */
    R queryAll();

    /**
     * 发布动态
     * @param dynamicAdd
     * @return
     */
    R addDynamic(DynamicAdd dynamicAdd,String ip);

    /**
     * 删除动态
     * @param did
     * @return
     */
    R removeDynamic(Integer did,String ip);

    /**
     * 根据类型查询动态
     * @param typeId
     * @return
     */
    R queryAllDynamicByType(Integer typeId);

    /**
     * 根据用户id查询动态
     * @param uid
     * @return
     */
    R queryAllDynamicByUserId(int uid);

    /**
     * 根据id查询动态
     * @param id
     * @return
     */
    R queryById(Integer id);

    /**
     * 上传封面页图片
     * @param file
     * @param did
     * @return
     */
    R upload(MultipartFile file, Integer did,String ip)throws IOException;
}
